package com.zhaolin.utils;

import com.zhaolin.entity.Survey;
import com.zhaolin.mapper.SurveyDao;
import com.zhaolin.service.SurveyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.List;

@EnableScheduling
public class ScheduleTask {
    @Autowired
    private SurveyService service;
    /*
    * 调查问卷任务状态定时器
    *
    * */
    //设置每隔1分钟去执行
    @Scheduled(cron = "* */1 * * * ?")
    public void state(){
        System.out.println("进来了");
        service.updateState();
    }
}
